<?php
class Administration extends MY_Controller{

	function __construct()
	{
		parent::__construct();
		if(!$this->admin || $this->admin->status !=1 ) redirect('login');

	}

	function index()
	{
		$data['admins'] = admin::find('all');
		$data['title'] = $this->title('administration');
		$this->load->view($this->theme->admin_theme.'/header',$data);
		$this->load->view($this->theme->admin_theme.'/preference/administration');
		$this->load->view($this->theme->admin_theme.'/footer');
	}

	function edit($id=NULL)
	{
		$admin = admin::find_by_id($id);
		if($admin)
		{
			$data['title'] = $this->title('administration');
			$data['admin'] = $admin;
			$this->load->view($this->theme->admin_theme.'/header',$data);
			$this->load->view($this->theme->admin_theme.'/preference/admin_edit',$data);
			$this->load->view($this->theme->admin_theme.'/footer');
				
		}else{
			redirect('preference/administration');
		}
	}
}